package Merlion.SCM.entity;

import Merlion.MRP.entity.ReservationEntity;
import java.io.Serializable;
import java.util.Date;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.OneToOne;
import javax.persistence.Temporal;

/**
 *
 * @author Indra
 */
@Entity
public class PickingOrderEntryEntity implements Serializable {

    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Long id;
    private Long productId;
    private int requestedQty; //static
    private int pickingQty;
    private String reservationType; //PDD, BKO, INV
    private String availabilityDate; //immutable
    private boolean voided;
    private boolean picked;
    private String status;
    private Long warehouseId;
    @Temporal(javax.persistence.TemporalType.DATE)
    private Date pickingDate;
    @OneToOne
    private ReservationEntity reservationEntity;

    public PickingOrderEntryEntity() {
    }

    public void create(Long productId, int requestedQty, int pickingQty, String reservationType, String availabilityDate, boolean voided, boolean picked, Long warehouseId, ReservationEntity reservationEntity) {
        this.productId = productId;
        this.requestedQty = requestedQty;
        this.pickingQty = pickingQty;
        this.reservationType = reservationType;
        this.availabilityDate = availabilityDate;
        this.voided = voided;
        this.picked = picked;
        this.warehouseId = warehouseId;
        this.reservationEntity = reservationEntity;
    }

    
    
    public ReservationEntity getReservationEntity() {
        return reservationEntity;
    }

    public void setReservationEntity(ReservationEntity reservationEntity) {
        this.reservationEntity = reservationEntity;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getAvailabilityDate() {
        return availabilityDate;
    }

    public void setAvailabilityDate(String availabilityDate) {
        this.availabilityDate = availabilityDate;
    }

    public boolean isPicked() {
        return picked;
    }

    public void setPicked(boolean picked) {
        this.picked = picked;
    }

    public String getReservationType() {
        return reservationType;
    }

    public void setReservationType(String reservationType) {
        this.reservationType = reservationType;
    }

    public boolean isVoided() {
        return voided;
    }

    public void setVoided(boolean voided) {
        this.voided = voided;
    }


    public int getPickingQty() {
        return pickingQty;
    }

    public void setPickingQty(int pickingQty) {
        this.pickingQty = pickingQty;
    }

    public Date getPickingDate() {
        return pickingDate;
    }

    public void setPickingDate(Date pickingDate) {
        this.pickingDate = pickingDate;
    }

    public Long getProductId() {
        return productId;
    }

    public void setProductId(Long productId) {
        this.productId = productId;
    }

    public int getRequestedQty() {
        return requestedQty;
    }

    public void setRequestedQty(int requestedQty) {
        this.requestedQty = requestedQty;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public Long getWarehouseId() {
        return warehouseId;
    }

    public void setWarehouseId(Long warehouseId) {
        this.warehouseId = warehouseId;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof PickingOrderEntryEntity)) {
            return false;
        }
        PickingOrderEntryEntity other = (PickingOrderEntryEntity) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Merlion.SCM.entity.PickingOrderEntryEntity[ id=" + id + " ]";
    }
}
